
<?php
  if (isset($_GET['pName'])) {
    /*$param = $_GET['type'];*/
    $xp = new XsltProcessor();
    // create a DOM document and load the XSL stylesheet
    $xsl = new DomDocument;
    $xsl->load('CV.xsl');
    $pName = $_GET['pName'];
    //import the XSL styelsheet into the XSLT process
    $xp->importStylesheet($xsl);
    // create a DOM document and load the XML datat
    $xml_doc = new DomDocument;
    $xml_doc->load("../xml/$pName");
    
    $xp->setParameter('','pName',$pName);

    // transform the XML into HTML using the XSL file
    if ($html = $xp->transformToXML($xml_doc)) {
      print $html;
    } else {
      trigger_error('XSL transformation failed.', E_USER_ERROR);
    } // if
  } else {
    print("<div><h1>404</h1></div>");
  }
?>
